<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="<s:property value="#application.website.keywords"/>" />
<meta name="description" content="<s:property value="#application.website.description"/>" />
<title>网上购卡-<s:property value="#application.website.websiteName"/></title>
<link href="css/css.css"  type="text/css" rel="stylesheet"/>
<link href="css/css.css"  type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="js/tools/jquery-1.4.2.min.js"></script>
<script>
 function check()
 {
      var reg=/^[0-9]+$/;
      var name=$.trim($("#name").val());
      var amount=$.trim($("#amount").val());
      var remark=$.trim($("#remark").val());
      var idcard=$.trim($("#idcard").val());
      if(name.length<1||name.length>12)
      {
        alert("姓名长度在1~12");
        return false;
      }else if(!reg.test(amount))
	   {
			 alert("办卡金额必需输入数字");
			  return false;
		}else if(idcard.length<1||idcard.length>20)
	   {
			 alert("身份证号的长度不对");
			  return false;
		}
		var param={};
		  param["buycard.name"]=encodeURI(name);
		  param["buycard.amount"]=amount;
		  param["buycard.cardType"]=$("#cardType").val();
		  param["buycard.remark"]=encodeURI(remark);
		  param["buycard.sex"]= $("input[type='radio']:checked").val();
		  param["buycard.idcard"]=$.trim($("#idcard").val());
		   param["buycard.tel"]=$.trim($("#tel").val());
		$.getJSON("buycard!addBuycardInfo.action",param,function(data){
		      if(data.info)
		      {
		        alert("添加成功!");
		      }else
		      {
		        alert("添加失败!");
		      }
		});
 }
</script>
</head>
<body>
 <div id="container">
   <div id="Header">
     <jsp:include page="../header.jsp"></jsp:include>
   </div>
   <div id="PageBody">
     <div class="mina">
       <div class="subleft">
         <div class="subnav">
           <img src="images/zy_22.gif" />
           <ul>
             <s:iterator value="list">
                 <li><a href="singlePage?columnId=<s:property value="columnId"/>&singlePage.id=<s:property value="id"/>"><s:property value="title"/></a></li>
             </s:iterator>
           </ul>
           <div class="navbott">资合信-易通卡</div>
         </div>
         <jsp:include page="../context.jsp"></jsp:include>
        
       </div>
       <div class="subright">
         <div class="subright01">
           <div class="subtitle"><s:property value="path" escape="false"/></div>
           <div class="subright02">
             <div class="buy">
               <s:property value="singlePage.content" escape="false"/>
             </div>
           </div>
         </div>
       </div>
     </div>
   </div>
   <div id="Footer">
     <jsp:include page="../bottom.jsp"></jsp:include>
   </div>
 </div>
</body>
</html>
